package com.zsy.springframework.context.event.chouxiang;

import com.zsy.springframework.beans.facotry.jiekou.one.BeanFactory;
import com.zsy.springframework.context.event.ApplicationListener;
import com.zsy.springframework.context.event.config.ApplicationEvent;

public class SimpleApplicationEventMulticaster extends AbstractApplicationEventMulticaster {
    public SimpleApplicationEventMulticaster(BeanFactory beanFactory) {
        setBeanFactory(beanFactory);
    }

    @SuppressWarnings("unchecked")
    @Override
    public void multicastEvent(ApplicationEvent event) {
        for (ApplicationListener applicationListener : getApplicationListeners(event)) {
            applicationListener.onApplicationEvent(event);
        }
    }
}
